﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NFit.WordML
{
    public static class WordFileMapHelpers
    {
        public static WordFileMapElement WithChild(this WordFileMapElement parent, string stylename, string name, ElementType elttype, string classname, Action<WordFileMapElement> act)
        {
            var newelt = parent.AddChild(stylename, name, elttype, classname);
            act(newelt);
            return parent;
        }

        public static WordFileMapElement WithChild(this WordFileMapElement parent, string stylename, string name, ElementType elttype,Action<WordFileMapElement> act)
        {
            var newelt = parent.AddChild(stylename, name, elttype);
            act(newelt);
            return parent;
        }

        public static WordFileMapElement WithChild(this WordFileMapElement parent, string stylename, string name, Action<WordFileMapElement> act)
        {
            var newelt = parent.AddChild(stylename, name);
            act(newelt);
            return parent;
        }

        public static WordFileMapElement WithChild(this WordFileMapElement parent, string stylename, Action<WordFileMapElement> act)
        {
            var newelt = parent.AddChild(stylename);
            act(newelt);
            return parent;
        }
    }
}
